package com.fandy.struts.DAL;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.fandy.struts.SqlAccess.SqlServerHelper;
import com.fandy.struts.SqlStatement.Order;


public class DALOrder {
 
	SqlServerHelper ssh = new SqlServerHelper(); 
	Order o = new Order();
	
	public   ResultSet  getAll()
	{
		return   ssh.executeScalar(o.getAll());
	}
	
	public   ResultSet getOrderInfoByID(int ID)
	{
		return  ssh.executeScalar(o.getOrderInfoByID(ID));
	}
	
	
	public int Add(com.fandy.struts.Model.Order or) throws SQLException
	{
		
		return  ssh.executeNoQuery(o.Add(or));
		
	}
	
	
	
//	public   String  existOrder(com.fandy.struts.Model.Order s)
//	{
//		return  ssh.executeScalar(o.);
//	}
	
	public int UpdateByID(int id,com.fandy.struts.Model.Order ord) throws SQLException
	{
		
		return ssh.executeNoQuery(o.UpdateByID(id, ord));
	}
	
	public int DeleteByID(int id) throws SQLException
	{
		
		return ssh.executeNoQuery(o.DeleteByID(id));
		
	}
	
	
	
}

